<?php
$this->headTitle($this->T('My Pages'));
?>

<div>
    <h2><?php echo $this->link($this->U('page', 'edit'), $this->T('New Page')); ?></h2>
</div>

<div class="cl" style="height:25px;">&nbsp;</div>

<div>
    <?php
    if (!empty($this->pages)) {
    ?>
        <div>

            <table width="100%" border="0" cellspacing="5" cellpadding="0">
                <tr>
                    <td class="list_head"><?php echo $this->T('No.'); ?></td>
                    <td class="list_head"><?php echo $this->T('Link'); ?></td>
                    <td class="list_head"><?php echo $this->T('Published'); ?></td>
                    <td class="list_head"><?php echo $this->T('Create at'); ?></td>
                </tr>

                <tr><td>&nbsp;</td></tr>

                <?php
                $i = 0;
                foreach ($this->pages as $page) {
                    ++$i;
                ?>

                <tr>
                    <td class="list_content"><?php echo $i; ?></td>
                    <td class="list_content">
                        <?php echo $this->link($this->U('page', 'edit', 'admin', array('id' => $page->pageId)), $page->pageLinkUrl . ' (.html)'); ?>
                    </td>
                    <td class="list_content"><?php echo (bool)$page->pagePublished ? 'yes' : 'no'; ?></td>
                    <td class="list_content"><?php echo $page->pageCreatedAt; ?></td>
                    <td class="list_content">
                        <?php
                        echo $this->link($this->U('page', 'delete', 'admin', array('id' => $page->pageId)), 
                                         $this->img('cross_red.jpg', '16', '16', 'delete'),
                                         false,
                                         array('onclick' => 'return confirm(\'Do you really want to delete this page ? (' . $page->pageLinkUrl . ')\');'));
                        ?>
                    </td>
                </tr>

                <?php
                }
                ?>

            </table>

        </div>

    <?php
    }
    ?>

</div>